﻿/****************************************************************
 * Copyright (c) 2010-2013 Besture All Rights Reserved.
 * 
 * File Name:		AppConfig 
 * 
 * Created:		2013-6-4 14:47:35
 * Original Author:	nitao 
 * 
 * ------------------------------------------------------------
 * MODIFICATION HISTORY
 * ------------------------------------------------------------
 * When			Who		Why
 * ------------------------------------------------------------
 * 
 *
 ****************************************************************/

using System.Configuration;

namespace Besture.Common
{
    public class AppConfig
    {
        /// <summary>
        /// 是否上线 0：未上线 1:已上线
        /// </summary>
        public static readonly string IsOnLine = ConfigurationManager.AppSettings["IsOnLine"];
        /// <summary>
        /// 注册短信模版
        /// </summary>
        public static readonly string SMSTemplate = ConfigurationManager.AppSettings["SMSTemplate"];
        /// <summary>
        /// 找回密码短信模版
        /// </summary>
        public static readonly string SMSCipherTemplate = ConfigurationManager.AppSettings["SMSCipherTemplate"];
        /// <summary>
        /// 找回密码短信模版
        /// </summary>
        public static readonly string SMSPWDTemplate = ConfigurationManager.AppSettings["SMSPWDTemplate"];
        /// <summary>
        /// 手机号正则表达
        /// </summary>
        public static readonly string SMSRegex = @"^1[3|4|5|8][0-9]\d{4,8}$";
        /// <summary>
        /// 后台是否需要登录 0：不登录 1:需要登录
        /// </summary>
        public static readonly string ADMIN_LOGIN_FLAG = ConfigurationManager.AppSettings["ADMIN_LOGIN_FLAG"];
        /// <summary>
        /// 前台是否需要登录 0：不登录 1:需要登录
        /// </summary>
        public static readonly string CLIENT_LOGIN_FLAG = ConfigurationManager.AppSettings["CLIENT_LOGIN_FLAG"];
        /// <summary>
        /// 礼券过期时间
        /// </summary>
        public static readonly string GiftDeadLineSpan = ConfigurationManager.AppSettings["InValidDaySpan"];

        /// <summary>
        /// 图片网络地址
        /// </summary>
        public static readonly string INTERNETNEWIMAGE = ConfigurationManager.AppSettings["InternetImage"];

        /// <summary>
        /// 网银支付key
        /// </summary>
        public static readonly string CHINABANK_MD5_KEY = ConfigurationManager.AppSettings["CHINABANK_MD5_KEY"];

        /// <summary>
        /// 网银支付服务号
        /// </summary>
        public static readonly string CHINABANK_CUSTOMER_NO = ConfigurationManager.AppSettings["CHINABANK_CUSTOMER_NO"];

        /// <summary>
        /// 返回接收支付结果的页面
        /// </summary>
        public static readonly string CHINABANK_RETURN_URL = ConfigurationManager.AppSettings["CHINABANK_RETURN_URL"];

        /// <summary>
        /// 异步返回
        /// </summary>
        public static readonly string ALIPAY_RETURN_URL = ConfigurationManager.AppSettings["ALIPAY_RETURN_URL"];

        #region 邮件配置

        /// <summary>
        /// 系统邮件地址
        /// </summary>
        public static string MAIL_ADDRESS = ConfigurationManager.AppSettings["DefaultFromMailAddress"];

        /// <summary>
        /// 系统邮件密码
        /// </summary>
        public static string MAIL_PASSWORD = ConfigurationManager.AppSettings["DefaultFromMailPassword"];

        #endregion

        #region 支付配置


        /// <summary>
        /// 商户帐号
        /// </summary>
        public static readonly string Alipay_CUSTOMER_EMAIL = ConfigurationManager.AppSettings["PAY_SELLER_EMAIL"];

        /// <summary>
        /// 合作id
        /// </summary>
        public static readonly string Alipay_PARTNER = ConfigurationManager.AppSettings["ALIPAY_PARTNER"];

        /// <summary>
        /// 商户key
        /// </summary>
        public static readonly string Alipay_KEY = ConfigurationManager.AppSettings["ALIPAY_KEY"];

        /// <summary>
        /// 返回URL
        /// </summary>
        public static readonly string Alipay_RETURN_URLS = ConfigurationManager.AppSettings["ALIPAY_RETURN_URLS"];

        /// <summary>
        /// 异步返回URL
        /// </summary>
        public static readonly string AUTO_ALIPAY_RETURN_URL = ConfigurationManager.AppSettings["AUTO_ALIPAY_RETURN_URL"];

        #endregion

        /// <summary>
        /// 管理网站地址
        /// </summary>
        public static readonly string ADMIN_URL = ConfigurationManager.AppSettings["ADMIN_URL"];

        /// <summary>
        /// 管理网站地址
        /// </summary>
        public static readonly string MSMPath = ConfigurationManager.AppSettings["MSMPath"];



        ///<summary>
        /// Apikey
        ///</summary>
        ///<remarks></remarks>
        public static string GetWeiboApiKey()
        {
            return ConfigurationManager.AppSettings["Weibo_Apikey"].ToString();
        }

        ///<summary>
        /// apiKeySecret
        ///</summary>
        ///<remarks></remarks>
        public static string GetWeiboApiKeySecret()
        {
            return ConfigurationManager.AppSettings["Weibo_apiKeySecret"].ToString();
        }

        ///<summary>
        /// 请求协议tonken地址
        ///</summary>
        ///<remarks></remarks>
        public static string GetWeiboRequestTokenUri()
        {
            return ConfigurationManager.AppSettings["Weibo_requestTokenUri"].ToString();
        }

        ///<summary>
        /// 请求协议code地址
        ///</summary>
        ///<remarks></remarks>
        public static string GeWeibotRequestCodeUri()
        {
            return ConfigurationManager.AppSettings["Weibo_requestCodeUri"].ToString();
        }

        ///<summary>
        /// redirect_uri
        ///</summary>
        ///<remarks></remarks>
        public static string GetWeiboredirect_uri()
        {
            return ConfigurationManager.AppSettings["Weibo_redirect_uri"].ToString();
        }
        
    }
}
